package com.haoan.index.common.enums;

import lombok.Getter;

/**
 * @Auther: Kai
 * @Date: 2024/8/1
 * @Description: 系统是否
 */
@Getter
public enum SysYesNo {
    YES("Y", "是", "是"),
    NO("N", "否", "否"),
    NOT_FOUND("", "NULL", "NULL");

    private final String code;
    private final String name;
    private final String remark;

    SysYesNo(String code, String name, String remark) {
        this.code = code;
        this.name = name;
        this.remark = remark;
    }

    public static SysYesNo getByCode(String code) {
        for (SysYesNo demoEnum : SysYesNo.values()) {
            if (demoEnum.getCode().equals(code)) {
                return demoEnum;
            }
        }
        return NOT_FOUND;
    }

}
